function gets(pageNum) {
    var pageN = pageNum;
    $("#pageNum").val(pageN);
    var serializeArray = $("#more-info-dialog").serializeArray();
    $.ajax({
            url: '/myspringboot/SettlementController/findAllSm',
            type: 'post',
            dataType: "json",
            data: serializeArray,
            success: function (result) {
                var result = result.data;
                yibu(result.pages, result.pageNum);
                var list = result.list;
                $(".a").empty();
             for (var i = 0; i < list.length; i++) {
                    var a = i+1;
                    var sId = list[i].sid;
                    var sNumber = list[i].snumber;
                    var sName = list[i].sname;

                    var purchaseOrder = list[i].purchaseOrder;
                    if (purchaseOrder!=null){
                        //采购单编号
                        var pNumber = purchaseOrder.poNumber;
                        //采购单名称
                        var poName = purchaseOrder.poName;
                        //开始采购时间
                        var poSubmissionTime = purchaseOrder.poSubmissionTime;
                        //结束采购时间
                        var poAuditTime = purchaseOrder.poAuditTime;
                    }else {
                        var  pNumber = "null"
                        var  poName = "null"
                        var  poSubmissionTime = "null"
                        var  poAuditTime = "null"
                    }
                    //采购医院
                    var hospital = list[i].hospital;
                    if (hospital != null) {
                        var hName = hospital.hName;
                    }else {
                        var hName = "null"
                    }
                    var drugInformation = list[i].drugInformation;
                    if (drugInformation  != null) {
                        //药品流水号
                        var diNumer = drugInformation.diNumer;
                        //通用名
                        var diName = drugInformation.diName;
                        //剂型
                        var diForm = drugInformation.diForm;
                        //规格
                        var diSpecifications = drugInformation.diSpecifications;
                        //单位
                        var diUnit =drugInformation.diUnit;
                        //转换系数
                        var diCc = drugInformation.diCc;
                    }else {
                        var diNumer ="null"
                        var diName ="null"
                        var diForm ="null"
                        var diSpecifications ="null"
                        var diUnit ="null"
                        var diCc ="null"
                    }
                    var drugAtegory = list[i].drugAtegory;
                    if (drugAtegory != null) {
                        //商品名
                        var daName = drugAtegory.daName;
                    }else {
                        var daName="null"
                    }
                    //质量层次
                    var drugQualityLevel = list[i].drugQualityLevel;
                    if (drugQualityLevel != null) {
                        var dqlName = drugQualityLevel.dqlName;
                    }else {
                        var dqlName = "null"
                    }
                    var tr = '<tr>' +
                        '<td>' + a + '</td>' +
                        '<td><input class="selectItem1" name="sdiId" value=' + sId + ' type="checkbox">' +
                        '<td>' + sNumber + '</td>' +
                        '<td>' + sName + '</td>' +
                        '<td>' + hName + '</td>' +
                        '<td>' + poSubmissionTime + '</td>' +
                        '<td>' + poAuditTime + '</td>' +
                        '<td>' + pNumber + '</td>' +
                        '<td>' + poName + '</td>' +
                        '<td>' + diNumer + '</td>' +
                        '<td>' + diName + '</td>' +
                        '<td>' + daName + '</td>' +
                        '<td>' + diForm + '</td>' +
                        '<td>' + diSpecifications + '</td>' +
                        '<td>' + diUnit + '</td>' +
                        '<td>' + diCc + '</td>' +
                        '<td>' + dqlName + '</td>' +
                        '</tr>'
                    $(".a").append(tr);
                }
            }
        }
    )
}

//全选
function selectAll(obj) {
    var checkboxEle = document.getElementsByClassName("selectItem1");
    for (var i = 0; i < checkboxEle.length; i++) {
        checkboxEle[i].checked = obj.checked;
    }
}

//获取复选框的值
function show() {
    obj1 = document.getElementsByClassName("selectItem1");
    var sdiI = [];
    for (k in obj1) {
        if (obj1[k].checked)
            sdiI.push(obj1[k].value);
    }
    $.ajax({
        url: '/myspringboot/SettlementController/updateState',
        type: 'post',
        dataType: 'json',
        traditional: true,
        data: {
            ids: sdiI,
        },
        success: function (result) {
            alert(result.msg)
            window.location.href = "returnorder.html";
        }
    })
}